package wifiunion.com.notice.presenter;

import android.content.Context;


import java.util.HashMap;

import wifiunion.com.notice.Constants;
import wifiunion.com.notice.NoticeRecordContact;
import wifiunion.com.notice.NoticeRecordModel;

/**
 * 通知对象
 */

public class NoticeRecordForTZDXPresenter implements NoticeRecordContact.Presenter, NoticeRecordContact.Callback {

    private NoticeRecordContact.View mView;
    private Context mContext;
    private NoticeRecordModel mModel;


    private HashMap<String,Object> param = new HashMap<>();


    public NoticeRecordForTZDXPresenter(Context context, NoticeRecordContact.View view) {
        mView = view;
        mContext = context;
        mModel = new NoticeRecordModel();
        mView.setPresenter(this);
    }

    @Override
    public void onSuccess(Object data) {

        mView.onNoticeTZDXSuccess(data);
    }

    @Override
    public void onServerFailed(Object errorObj) {
        mView.onError(errorObj);
    }

    @Override
    public void onNetFailed() {

        mView.onError("网络异常");
    }

    @Override
    public void start() {
        HashMap<String, Object> params = new HashMap<String, Object>();
        mModel.loadData(Constants.HTTP_URL_GET_STATISTICS_TRIGGERLIST, params, this);
    }

    @Override
    public void start(HashMap<String, Object> params) {
        mModel.getTZDXDetail(Constants.HTTP_URL_GET_STATISTICS_NOTICETZDX, params, this);
    }
}
